package com.android.toast

import android.view.MotionEvent
import android.view.View

/**
 * @Author LuoKun
 * @Des
 */
class ViewTouchWrapper : View.OnTouchListener {

    private var mToast: AndroidToast<*>
    private var mListener: AndroidToast.OnTouchListener<View>

    constructor(mToast: AndroidToast<*>, mListener: AndroidToast.OnTouchListener<View>) {
        this.mToast = mToast
        this.mListener = mListener
    }

    override fun onTouch(p0: View, p1: MotionEvent): Boolean {
        if (mListener == null) {
            return false
        }
        return mListener.onTouch(mToast, p0, p1)
    }
}